package com.web.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RoundRobinRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 自定义Ribbon规则
 */
@Configuration
public class MySelfRule {
    @Bean
    public IRule myRule(){
        //return new RandomRule();//自定义随机
        return new RoundRobinRule();//轮询
    }

}
